{include file="public/admin_head.html"}

<body>
<form class="form-horizontal" method ="post" action ="{$host}/index.php?act=admin&st=insert_admin_user" onsubmit="return validate(this)">
	<fieldset>
	<legend><B>添加用户信息</B></legend>
	<div class="control-group">
		<input type="hidden" value="{$session.token}" name="token">
	  <label for="user_name" class="control-label">用户名：<font color="#FF0000">*</font></label>
	  <div class="controls">
	    <input type="text" id="user_name" class="input-xlarge" name="user_name">
	  </div>
	</div>
	
	<div class="control-group">
	  <label for="password" class="control-label">用户密码：<font color="#FF0000">*</font></label>
	  <div class="controls">
	    <input type="password" id="password" class="input-xlarge" name="user_pwd">
	    <span id ="pa_msg" class="label label-warning"></span>
	  </div>
	</div>

	<div class="control-group">
	  <label for="repassword" class="control-label">确认密码：<font color="#FF0000">*</font></label>
	  <div class="controls">
	    <input type="password" id="repassword" class="input-xlarge" name="user_comfirm_pwd" >
	    <span id ="msg" class="label label-warning"></span>
	  </div>
	</div>
	<div class="control-group">
	  <label class="control-label" for="admin_type">角色名称：</label>
	  <div class="controls">
		  <select name="admin_type" id="admin_type">
                <option value="1">超级管理员</option>
    	        <option value="2" selected='selected'>普通管理员</option>
    	  </select>
	  </div>
	</div>
	<div class="control-group">
	  <label for="real_name" class="control-label">真实姓名：</label>
	  <div class="controls">
	    <input type="text" id="real_name" class="input-xlarge" name="real_name">
	  </div>
	</div>
   </fieldset>
	<div class="form-actions">		
		<a href="javascript:history.back();" class="btn">返回</a>
		<button class="btn btn-primary width-100 left-60" type="submit"> 确 认 </button>
	</div>
    </form>

<script>
function validate(obj){
	var repassword = $("#repassword").val();
	var password = $("#password").val();
	var username = $("#user_name").val();
	if($.trim(username) == ''){
		alert('用户名不能为空');
		$("#user_name").focus();
		return false;
	}
	if($.trim(password) == ''){
		alert("用户密码不能为空");
		$("#password").focus();
		return false;
	}
	if($.trim(repassword) == ''){
		alert("确认密码不能为空");
		$("#repassword").focus();
		return false;
	}
	if($.trim(password) != $.trim(repassword)) {
		alert("两次输入的密码不匹配，请再次输入密码");
		$("#password").focus();
		return false;
	}
}
</script>


{include file="public/admin_foot.html"}
